<template>
  <div>
    <h1>我是Child1组件</h1>
    <h2>哥哥给我的:{{ c }}</h2>
  </div>
</template>

<script setup lang="ts">
import $bus from '@/bus';
import { onMounted,ref} from 'vue';
let c = ref()
// 组件挂载完毕
onMounted(() => {
    $bus.on('sendcart',(val)=>{
        c.value = val
    })  
})


</script>

<style  scoped>

</style>